<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="t_product" :rules="rules" label-width="100px" id="mvcfm">
          <div class="form-unit">
            <span class="mvc-title-left"> 工艺管理 </span>
          </div>
          <el-table :data="t_product">
            <el-table-column label="#" align="center" type='index'>
            </el-table-column>
            <el-table-column label="工艺名称" prop="category_id">
              <template slot-scope="scope">
                <el-link @click="popDetectionFlow('&CMIDcategory_id='+scope.row.category_id+'')" type='primary'>{{scope.row.pro_name}}</el-link>
              </template>
            </el-table-column>
          </el-table>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'工艺管理'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
    <el-dialog :visible.sync="DetectionFlowVisible" append-to-body>
      <DetectionFlow v-if="DetectionFlowVisible" ref="DetectionFlow" :popparams="popparams"> </DetectionFlow>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import DetectionFlow from "@/views/psi/product/DetectionFlow";
  export default {
    name: 'ProcessManagement',
    components: {
      DetectionFlow,
    },
    props: ['popparams'],
    data() {
      return {
        DetectionFlowVisible: false,
        DetectionFlowValue: null,
        DetectionFlowDesc: null,
        vueparams: this.getVUEParams(""),
        t_product: [],
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "C1BDE411EFF7473EAF5F658AF81F2689",
        name: "产品目录右菜单",
        selected: "工艺管理"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/product/ProductAction/processManagement?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popDetectionFlow(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.DetectionFlowVisible = !this.DetectionFlowVisible;
      },
    },
  }
</script>
